package com.example.demo.vo

import com.example.demo.dbmodels.TFee
import io.swagger.annotations.ApiModelProperty
import java.math.BigDecimal
import java.time.LocalDateTime

class FeeVo {
    /**
     *  id
     **/
    var id: Int? = null
    /**
     *  发票号
     **/
    var inv_no: String? = null
    /**
     *  病人编号
     **/
    var patient_code: String?= null
    /**
     *  住院号
     **/
    var cure_no: String? = null
    /**
     *  计费时间
     **/
    var cost_time: LocalDateTime? = null
    /**
     *  费用编号
     **/
    var item_code: String? = null
    /**
     *  费用名称
     **/
    var item_name: String?= null
    /**
     *  费用明细
     **/
    var item_detail: String? = null
    /**
     *  数量
     **/
    var bill_qty: BigDecimal?= null
    /**
     *  单位
     **/
    var unit: String? = null
    /**
     *  单价
     **/
    var unit_price: BigDecimal? = null
    /**
     *  折扣单价
     **/
    var disc_price: BigDecimal?= null
    /**
     *  社保单价
     **/
    var ins_price: BigDecimal?= null
    /**
     *  自付单价
     **/
    var pat_price: BigDecimal?= null
    /**
     *  折扣金额
     **/
    var disc_amount: BigDecimal?= null
    /**
     *  记账金额
     **/
    var payor_amount: BigDecimal?= null
    /**
     *  自付金额
     **/
    var pat_amount: BigDecimal?= null
    /**
     *  总金额
     **/
    var total_amount: BigDecimal?= null
    /**
     *  缴费状态（0-未支付，1-已支付)
     **/
    var status: Int?= null
    /**
     *  更新人
     **/
    var update_by: Int?= null
    /**
     *  更新时间
     **/
    var update_time: LocalDateTime?= null
    /**
     *  删除标记
     **/
    var is_del: Boolean?= null


    fun getVo(table: TFee): FeeVo {
        table.let {
            val data = FeeVo()
           data.bill_qty = it.bill_qty
            data.cost_time = it.cost_time
            data.cure_no = it.cure_no
            data.disc_amount = it.disc_amount
            data.disc_price = it.disc_price
            data.id = it.id
            data.ins_price = it.ins_price
            data.inv_no = it.inv_no
            data.is_del = it.is_del
            data.item_code = it.item_code
            data.item_detail = it.item_detail
            data.item_name = it.item_name
            data.pat_amount = it.pat_amount
            data.pat_price = it.pat_price
            data.patient_code = it.patient_code
            data.payor_amount = it.payor_amount
            data.status = it.status
            data.total_amount = it.total_amount
            data.unit = it.unit
            data.unit_price = it.unit_price
            data.update_by = it.update_by
            data.update_time = it.update_time

            return data
        }
    }

    fun getListVo(table:List<TFee>):List<FeeVo> {
        table.let {
            val feeVoList = mutableListOf<FeeVo>()
            it.forEach {
                val data = FeeVo()
                data.bill_qty = it.bill_qty
                data.cost_time = it.cost_time
                data.cure_no = it.cure_no
                data.disc_amount = it.disc_amount
                data.disc_price = it.disc_price
                data.id = it.id
                data.ins_price = it.ins_price
                data.inv_no = it.inv_no
                data.is_del = it.is_del
                data.item_code = it.item_code
                data.item_detail = it.item_detail
                data.item_name = it.item_name
                data.pat_amount = it.pat_amount
                data.pat_price = it.pat_price
                data.patient_code = it.patient_code
                data.payor_amount = it.payor_amount
                data.status = it.status
                data.total_amount = it.total_amount
                data.unit = it.unit
                data.unit_price = it.unit_price
                data.update_by = it.update_by
                data.update_time = it.update_time
                feeVoList.add(data)
            }
            return  feeVoList
        }
    }

}